<%-- 
    Document   : phanquyencanhan
    Created on : Nov 6, 2011, 9:50:44 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,Beans.NhomNhanVien,Beans.PhanQuyenNhom,Beans.ThamSoHT,Models.ThamSoHT_Model, Models.NhanVien_Model, Models.PhanQuyenNhom_Model"%>
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'groupuser', 'rightmsg', 'save', 'notice', 'msgphanquyen', 'user', 'persondecentra', 'powerlist'  ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.            
            String groupuser = mdsts[0].getTenTS();
            String msgphanquyen = mdsts[1].getTenTS();
            String notice = mdsts[2].getTenTS();
            String persondecentra = mdsts[3].getTenTS();
            String powerlist = mdsts[4].getTenTS();
            String rightmsg = mdsts[5].getTenTS();
            String save = mdsts[6].getTenTS();
            String user = mdsts[7].getTenTS();
            String msgright = notice + "/" + rightmsg;
            String msg = notice + "/" + msgphanquyen;

            String mannv = (String) request.getAttribute("mannv");
            String manv = (String) request.getAttribute("manv");
%>
<h1><img style="margin-right: 13px; opacity: 0.8; margin-top: 6px;" alt="" src="../images/user11.png"><%=user %></h1>
<div class="bloc" style=" margin-top: 15px;">
    <div class="title">
        <%=persondecentra%>
    </div>
    <div class="content">
        <form action="" name="phanquyen">
            <table>
                <thead>
                    <tr>
                        <th style=" width: 15%;"><%=groupuser%></th>
                        <th><%=powerlist%></th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td style="padding-left: 10px;"><%=NhanVien_Model.LayTenNhom(Integer.parseInt(mannv), langid) %></td>
                        <td>
                            <%
                                            PhanQuyenNhom[] dsnq = PhanQuyenNhom_Model.DSNhomQuyen(Integer.parseInt(mannv));
                                            for (int j = 0; j < dsnq.length; j++) {%>
                            <div style=" width: 185px; float: left; padding: 5px;">
                                <%
                                                                        if (NhanVien_Model.CheckQuyen(dsnq[j].getMaQuyen(), Integer.parseInt(manv))) {%>
                                <input type="checkbox" name="chkquyen" checked value="<%=dsnq[j].getMaQuyen()%>">
                                <%  } else {%>
                                <input type="checkbox" name="chkquyen" value="<%=dsnq[j].getMaQuyen()%>">
                                <%  }
                                %>                                    
                                <label><%=NhanVien_Model.LayTenQuyen(dsnq[j].getMaQuyen(), langid)%></label>
                            </div>
                            <%  }
                            %>
                        </td>
                    </tr>
                </tbody>
            </table>
            <input type="button" class="button" style="margin-top: 10px;" value="<%=save%>" alt="<%=manv%>" id="<%= msg%>" lang="<%=msgright%>"  onclick="UpdateQuyenCaNhan(this.alt, this.id, this.lang)">
        </form>
    </div>
</div>

